package com.fzn.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @program: SpringMVC
 * 描述：使用RESTFul
 *  模拟用户的增删改查
 * @author: fzn
 * @create: 2022-03-01 19:57
 **/
@Controller
public class UserController {

    @GetMapping("/user")
    public String getAllUser() {
        System.out.println("查询所有用户信息");
        return "success";
    }

    @GetMapping("/user/{id}")
    public String getUserById() {
        System.out.println("根据id查询用户信息");
        return "success";
    }

    @PostMapping("/user")
    public String insertUser(String username, String password){
        System.out.println("添加用户信息："+username+","+password);
        return "success";
    }




}